package com.equipment.system.web.api;

import com.equipment.system.pojo.EchartData;
import com.equipment.system.service.EchartService;
import com.equipment.system.web.utils.Rest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

/**
 * ${DESCRIPTION}
 *
 * @author 杨凯
 * @create 2018-03-30 9:50
 **/
@RestController
@RequestMapping("/echart")
public class EchartController {


	@Autowired
	private EchartService echartService;


	@GetMapping("/equipment")
	public Rest getEquipmentChart(){
		Rest.Builder rest = Rest.newBuilder();
		Set<EchartData> mapData = echartService.getMapDataByProvince();
		rest.put("mapData",mapData);
		return rest.build();
	}
}
